package sojo.com.inverter.enums;


/**
 * @author cheng_hu
 * @description: 告警1
 * @date 2023-02-25 14:04:43
 */
public enum AlarmEnum_5 {
    Alarm_0(0, 2104, "直流端子温度异常", "重要"),
    Alarm_1(1, 2105, "黑启动失败", "重要"),
    Alarm_2(2, 2106, "黑启动指令时序异常", "重要"),
    Alarm_3(3, 2107, "PCS间并机CAN通信断链", "重要");


    private int bit; //bit值
    private int alarmId; //告警ID
    private String alarmName; //告警名称
    private String alarmLevel; //告警级别
    AlarmEnum_5(int bit, int alarmId, String alarmName, String alarmLevel) {
        this.bit = bit;
        this.alarmId = alarmId;
        this.alarmName = alarmName;
        this.alarmLevel = alarmLevel;
    }

    public static String getAlarmName(int bit) {
        for (AlarmEnum_5 alarmEnum : AlarmEnum_5.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmName();
            }
        }
        return "";
    }

    public static int getAlarmId(int bit) {
        for (AlarmEnum_5 alarmEnum : AlarmEnum_5.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmId();
            }
        }
        return -1;
    }

    public static String getAlarmLevel(int bit) {
        for (AlarmEnum_5 alarmEnum : AlarmEnum_5.values()) {
            if (bit == alarmEnum.getBit()) {
                return alarmEnum.getAlarmLevel();
            }
        }
        return "";
    }

    public String getAlarmLevel() {
        return alarmLevel;
    }

    public void setAlarmLevel(String alarmLevel) {
        this.alarmLevel = alarmLevel;
    }

    public int getBit() {
        return bit;
    }

    public void setBit(int bit) {
        this.bit = bit;
    }

    public int getAlarmId() {
        return alarmId;
    }

    public void setAlarmId(int alarmId) {
        this.alarmId = alarmId;
    }

    public String getAlarmName() {
        return alarmName;
    }

    public void setAlarmName(String alarmName) {
        this.alarmName = alarmName;
    }
}
